# Contributor: Taner Tas <taner76@gmail.com>
# Maintainer: Taner Tas <taner76@gmail.com>
pkgname=libmysofa
pkgver=1.3.2
pkgrel=0
pkgdesc="Set of C functions to read AES SOFA files"
url="https://github.com/hoene/libmysofa"
license="BSD-3-Clause-Clear"
arch="all"
arch="$arch !s390x" # tests fail
makedepends="
	cmake
	cunit-dev
	samurai
	zlib-dev
	"
checkdepends="nodejs"
subpackages="$pkgname-dev $pkgname-tools"
source="$pkgname-$pkgver.tar.gz::https://github.com/hoene/libmysofa/archive/v$pkgver.tar.gz
	install-header.patch
	"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCODE_COVERAGE=OFF \
		-DBUILD_TESTS=ON \
		-DBUILD_STATIC_LIBS=OFF
	cmake --build build
}

check() {
	ctest -j1 --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

tools() {
	pkgdesc="$pkgdesc (tools)"

	amove usr/bin
	amove usr/share
}

sha512sums="
de7f5d36079b8be06860f3380c7a359e22f59e3e57d86f5f5df1512a20b321e392e2452a34f3ea979779fb84c7493fd4febd386c89b6da4182d6c0cfb0ce1d75  libmysofa-1.3.2.tar.gz
35bcc9836db9873826a558146dce9045000f4c4028bc52f0940cf24a60cc515c1765adfa8134c24c72b9cc29dc7b08f9fa111bec9f54127a46df7285a785088c  install-header.patch
"
